package com.jingle.tutorial;

import java.util.Random;

import com.jingle.tutorial.other.CarMaster;

public class Dealership
{
	
	
	
	
	public static final CarMaster newCar()
	{
		CarAttributeCache.setRand(new Random(System.currentTimeMillis()));
		
		String make = PickRand.getRandom(CarAttributeCache.getMakes());
		String color = PickRand.getRandom(CarAttributeCache.getColors());
		String pimpLevel = CarAttributeCache.getPimplevelarray()[CarAttributeCache.getRand().nextInt(CarAttributeCache.getPimplevelarray().length)];
		String model = null;

		if( make == "Ford")
		{
			model = PickRand.getRandom(CarAttributeCache.getFords());
		}
		else if(make == "Toyota")
		{
			model = PickRand.getRandom(CarAttributeCache.getToyotas());
		}
		else if (make == "Chevy")
		{
			model = PickRand.getRandom(CarAttributeCache.getChevys());
		}
		else if (make == "Jeep")
		{
			model = PickRand.getRandom(CarAttributeCache.getJeeps());
		}
		else if (make == "Dodge")
		{
			model = PickRand.getRandom(CarAttributeCache.getDodges());
		}

		return new CarMaster(make, model, color, pimpLevel);
	}
	// Create a public static final method that returns a CarMaster with randomly generated attributes
}